package com.example.recorder;


import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;


/**
 * @author hdz
 * @date 2019/06/23
 */
public class WorkFragment extends Fragment {

    private VisualizerView visualizerView;

    public WorkFragment() {
        // Required empty public constructor
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        return inflater.inflate(R.layout.fragment_work, container, false);
    }

    @Override
    public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);

        visualizerView = view.findViewById(R.id.visualizer);
    }

    public void updateVisualizer(short[] audioData) {
        this.visualizerView.updateVisualizer(audioData);
    }

    public VisualizerView getVisualizerView() {
        return visualizerView;
    }
}
